﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MainForm.aspx.cs" Inherits="Frame_MainForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>欢迎使用《.NET权限系统 V2.0》</title>
    <link href="/Themes/Styles/style.css" rel="stylesheet" type="text/css" />
    <link href="/Themes/Styles/Menu.css" rel="stylesheet" type="text/css" />
    <link href="/Themes/Scripts/artDialog/skins/blue.css" rel="stylesheet" type="text/css" />
    <link href="/Themes/Scripts/TreeView/treeview.css" rel="stylesheet" type="text/css" />

    <script src="/Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/artDialog/artDialog.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/TreeView/treeview.pack.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/common.js" type="text/javascript"></script>
    <script type="text/javascript">
        var table = "";
        var db = "";
        var tableRemark = "";
        $(function () {
            divresize(29);
            AutoTreeCss();
            TreeBulid();
            Tick();
            $(".node-normal div span").contextmenu(Menu());
        });
        //树点击事件
        function TreeBulid() {
            $(".node-normal div").mousedown(function () {
                $(".node-normal div").removeClass("collapsableselected");
                $(this).addClass("collapsableselected"); //添加选中样式
                table = $(this).find('span').html();
                db = $(this).find('span').attr('database');
                tableRemark = $(this).find('span').attr('tableRemark');
            })
        }
        /**安全退出**/
        function IndexOut() {
            top.ShowConfirmMsg('确定要安全退出吗？', function (r) {
                if (r) {
                    Ajax('/Ajax/Common_Ajax.ashx?action=LoginOut', "", function (rs) {
                        window.parent.location.href = "/index.htm";
                    });
                }
            });
        }
        //右键菜单
        function Menu() {
            var menu = {//mtype 为自定义变量
                width: 150, items: [
                 { text: "后台代码生成", icon: "/Themes/Images/ContextMenu/page_white_csharp.png", mtype: "1", action: MenuAction },
                 { text: "Web表单页面生成", icon: "/Themes/Images/ContextMenu/20131015062126188.png", mtype: "2", action: MenuAction },
                 { text: "Web列表页面生成", icon: "/Themes/Images/ContextMenu/application.png", mtype: "3", action: MenuAction },
                 { text: "新建查询", icon: "/Themes/Images/ContextMenu/sql.png", mtype: "4", action: MenuAction }
                ], onShow: Applyrule
            }
            return menu;
        }
        function Applyrule(menu) {
            menu.applyrule({ name: "all", disable: true, items: [] });
        }
        // 右键事件
        function MenuAction() {
            var type = this.data.mtype;
            var url = "";
            var name = "";
            var tabId = "";
            switch (type) {
                case "1": url = "/Bulid/Business.aspx?"; name = "后台代码生成"; tabId = "Behind"; break;//刷新当前
                case "2": url = "/Bulid/Form.htm?type=form&"; name = "Web表单页面生成"; tabId = "Form"; break;//清空所有标签 保留** 暂未实现
                case "3": url = "/Bulid/Form.htm?type=list&"; name = "Web列表页面生成"; tabId = "Form"; break;//清空所有标签 保留首页
                case "4": url = "/Bulid/SQLQuery.aspx?"; name = "新建查询"; tabId = "Query"; break;//查询
                default:
            }
            url += "table=" + escape(table) + "&db=" + escape(db) + "&tableRemark=" + tableRemark;
            TabMenu(name, tabId, url, type);
        }
        function TabMenu(name, tabId, url, type) {
            var img = "";
            switch (type) {
                case "1": img = "config.png"; break;
                case "2": img = "page_white_csharp.png"; break;
                case "3": img = "browse.png"; break;
                case "4": img = "sql.png"; break;
            }
            CloseTab(tabId);
            AddTabMenu(tabId, url, name, img, 'true');
        }
        function ShowTime(objD) {
            var str, colorhead, colorfoot;
            var yy = objD.getYear();
            if (yy < 1900) yy = yy + 1900;
            var MM = objD.getMonth() + 1;
            if (MM < 10) MM = '0' + MM;
            var dd = objD.getDate();
            if (dd < 10) dd = '0' + dd;
            var hh = objD.getHours();
            if (hh < 10) hh = '0' + hh;
            var mm = objD.getMinutes();
            if (mm < 10) mm = '0' + mm;
            var ss = objD.getSeconds();
            if (ss < 10) ss = '0' + ss;
            var ww = objD.getDay();
            if (ww == 0) colorhead = "<font>";
            if (ww > 0 && ww < 6) colorhead = "<font>";
            if (ww == 6) colorhead = "<font>";
            if (ww == 0) ww = "星期日";
            if (ww == 1) ww = "星期一";
            if (ww == 2) ww = "星期二";
            if (ww == 3) ww = "星期三";
            if (ww == 4) ww = "星期四";
            if (ww == 5) ww = "星期五";
            if (ww == 6) ww = "星期六";
            colorfoot = "</font>"
            str = colorhead + yy + "-" + MM + "-" + dd + " " + hh + ":" + mm + ":" + ss + "  " + ww + colorfoot;
            return (str);
        }
        function Tick() {
            var today;
            today = new Date();
            document.getElementById("localtime").innerHTML = ShowTime(today);
            window.setTimeout("Tick()", 1000);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div id="Container">
            <div id="Header">
                <div id="HeaderLogo">
                </div>
                <div id="Headermenu">
                </div>
            </div>
            <div id="Headerbotton">
                <div id="left_title" style="width: 255px;">
                    <img src="/Themes/Images/clock_32.png" alt="" width="20" height="20" style="vertical-align: middle; padding-bottom: 1px;">
                    <span id="localtime" style="font-weight: normal;"><font>2014-07-13 18:20  星期日</font></span>
                </div>
                <div id="conten_title">
                    <div id="dww-menu" class="mod-tab">
                        <div class="mod-hd" style="float: left">
                            <ul class="tab-nav" id="tabs_container">
                            </ul>
                        </div>
                        <div id="toolbar" style="text-align: right; padding-right: 3px;">
                            <img src="/Themes/Images/refresh.png" title="刷新当前窗口" alt="" onclick="Loading(true);RefreshCurrentModule();;return false;" width="20" height="20" style="padding-bottom: 1px; cursor: pointer; vertical-align: middle;">
                            <img src="/Themes/Images/4963_home.png" title="主页" alt="" onclick="RePage()" width="20" height="20" style="padding-bottom: 1px; cursor: pointer; vertical-align: middle;">
                            <img src="/Themes/Images/Maximize_Press.png" title="最大化" alt="" onclick="Maximize();" width="20" height="20" style="padding-bottom: 1px; cursor: pointer; vertical-align: middle;">
                            <img src="/Themes/Images/button-white-stop.png" title="安全退出" alt="" onclick="IndexOut()" width="20" height="20" style="padding-bottom: 1px; cursor: pointer; vertical-align: middle;">
                        </div>
                    </div>
                </div>
            </div>
            <div id="MainContent">
                <div class="navigation" style="width: 255px;">
                    <div class="box-title">
                        对象资源管理器
                    </div>
                    <div class="div-body" style="border: none; overflow: scroll;">
                        <%=strHtml %>
                    </div>
                </div>
                <!--内容窗口-->
                <div id="ContentPannel">
                    <%--<iframe id="tabs_iframe_iframeset_id" name="tabs_iframe_iframeset_Name" height="100%" width="100%" frameborder="0" src="HomeIndex.aspx"></iframe>--%>
                </div>
            </div>
        </div>
        <div id="loading" onclick="Loading(false);">
            正在处理，请稍待。。。
        </div>
        <div id="Toploading">
        </div>
        <div id="fullreturn" title="还原" onclick="Fullrestore()">
        </div>
    </form>
</body>
</html>
